<template>
	<view>
		<view style="height: 20rpx;"></view>
		<view class="address-view">
			<uni-cell title="姓名" :isField="true" v-model="nickname" placeholder="请输入收货人姓名"></uni-cell>
			<uni-cell title="手机号" :isField="true" v-model="phone" placeholder="请输入手机号码"></uni-cell>
			<uni-cell title="所选地区" :isLink="true">
				<template #value>
					<AddressPicker @change="onCityChange" :level="3" style="width: 100%;">{{ regionText }}</AddressPicker>
				</template>
			</uni-cell>
			<uni-cell title="详细地址" v-model="address" placeholder="请输入详细地址" :isField="true" :isLine="false"></uni-cell>
		</view>
		<view style="height: 17rpx;"></view>
		<view class="address-view"><uni-cell title="设置为默认地址" @onSwitch="onSwitch" :isSwitch="true" :isLine="false" :switchVal="isDefault"></uni-cell></view>
		<view style="height: 100rpx;"></view>

		<button type="default" class="default-btn" @click="onConfirm">确定</button>
		<button type="default" class="default-btn grey-btn" @click="onDelect" v-if="!isAdd">删除</button>
	</view>
</template>

<script src="./address-edit.js"></script>

<style lang="scss">
@import '@/style/common.scss';
@import './address-edit.scss';
</style>
